import { createApp } from 'vue'
import App from './App.vue'

import './assets/global.less'

// 阿里图标资源引入。请按照需要到https://www.iconfont.cn/新建项目选好图标然后把资源下载放进来
import "@/assets/aliIcon/menu/iconfont.css"

// unplugin-vue-components插件无法处理非组件模块，因此我们需要手动导入这些样式。less导这个文件，css导入css.js
import "ant-design-vue/es/modal/style/index"   
import "ant-design-vue/es/notification/style/index"   
import "ant-design-vue/es/message/style/index"   

const app = createApp(App)

import pinia from "@/store/install"
app.use(pinia)

import router from './router'
app.use(router)

import filters from "@/common/filters"
app.use(filters)


import globalProperties from './common/addGlobalProperty'
app.use(globalProperties)

import "@/common/addWindowProperty"

import i18n from "@/locales"
app.use(i18n)
// console.log(app)


// 打印功能添加，该版本有问题，有时会报错，之后有新版本请更新依赖
import vuePrint from "vue3-print-nb"
app.use(vuePrint)


// 错误处理可以防止子组件的错误向上蔓延，使得在某些错误下项目可以继续正常运行。只要该函数存在，就可忽略错误继续运行
if(import.meta.env.VITE_NODE_ENV != 'dev')
app.config.errorHandler=(err,errvc,errinfo)=>{
   console.log(err,errvc,errinfo)
}

app.mount('#app')
